|
|
|
|
@ -115,7 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectInstrumentListByUserId" resultMap="WxInstrumentResult" parameterType="Long">
|
|
|
|
|
<select id="selectBindingInstrumentListByUserId" resultMap="WxInstrumentResult" parameterType="Long">
|
|
|
|
|
SELECT
|
|
|
|
|
ins.*
|
|
|
|
|
FROM
|
|
|
|
|
@ -130,6 +130,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
ui.create_time DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectUnbindingInstrumentListByUserId" resultMap="WxInstrumentResult" parameterType="Long">
|
|
|
|
|
SELECT
|
|
|
|
|
ins.*
|
|
|
|
|
FROM
|
|
|
|
|
wx_instrument ins
|
|
|
|
|
WHERE
|
|
|
|
|
ins.id NOT IN (
|
|
|
|
|
SELECT
|
|
|
|
|
ui.instrument_id
|
|
|
|
|
FROM
|
|
|
|
|
wx_user_instrument ui
|
|
|
|
|
WHERE
|
|
|
|
|
ui.user_id = #{userId}
|
|
|
|
|
AND ui.binding_status = 0
|
|
|
|
|
AND ui.`STATUS` = 0
|
|
|
|
|
)
|
|
|
|
|
ORDER BY ins.sort_no DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertWxInstrument" parameterType="WxInstrument" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
<selectKey keyProperty="id" resultType="Long" order="AFTER">
|
|
|
|
|
SELECT LAST_INSERT_ID()
|
|
|
|
|
|