how can I pass constant value '1111' to a nested column with mybatis association?
<association property="certificateType" column="{VALUE=CERTIFICATE_TYPE,TYPE='1111'}" select="getDict"/>
how can I pass constant value '1111' to a nested column with mybatis association?
<association property="certificateType" column="{VALUE=CERTIFICATE_TYPE,TYPE='1111'}" select="getDict"/>
Depending on what your db is, you can use
IFNULL(#{TYPE}, '1111')
(mysql)
ISNULL(#{TYPE}, '1111')
(sql server)
In your subquery (getDict).
Another solution is that your parent query can return TYPE as a value
For example by saying:
SELECT '1111' AS TYPE, .....
Then in your column you can just say
column={VALUE=CERTIFICATE_TYPE,TYPE=TYPE}
Hope that helps.